#include <bits/stdc++.h>
using namespace std;

// #define ONLINE_JUDGE

#ifndef ONLINE_JUDGE
#define dbg(x...) { cerr << "\033[32;1m" << #x << " -> "; err(x); }
void err() { cerr << "\033[39;0m" << endl; }
template<typename T, typename... A>
void err(T a, A... x) { cerr << a << ' '; err(x...); }
#else
#define dbg(...)
#endif

typedef long long LL;

const int N = 1e5+50;

typedef pair<int, int> P;

P a[N];
int n;

P b[N];

P operator - (const P &a, const P & b)
{
	return P(a.first - b.first, a.second -  b.second);
}

int main(int argc, char const *argv[])
{
	scanf("%d", &n);
	for (int i=0; i<n; ++i)
		scanf("%d%d", &a[i].first, &a[i].second);

	for (int i=0; i<n; ++i)
		b[i] = a[(i+1)%n] - a[i];
	
	if (n % 2)
	{
		puts("NO");
		return 0;
	}
	bool suc = true;
	int shf = n/2;
	for (int i=0; i<shf; ++i)
	{
		if ((b[i].first + b[i+shf].first) != 0 || (b[i].second + b[i+shf].second) != 0)
		{
			suc = false;
			break;
		}
	}

	if (suc) puts("YES");
	else puts("NO");
	return 0;
}